<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>Hello</div>
    <div>Hi</div>
    <div id="root">哈哈</div>
    <p class="text">guanuyu</p>
    <div class="nav">nav1</div>
    <div class="nav">nav2</div>

    <form name="login"></form>
    <script>
       var div1= document.getElementsByTagName("div")[0]
       div1.innerHTML="HelloWorld";
       console.log(div1);
       var text=document.getElementsByClassName("text")[0];
      // console.log(text);

       text.innerHTML="ssd";

       var name=document.getElementsByName("login")
       console.log(name);

       var root=document.getElementById("root");
       root.innerHTML="呵呵"

      /* var navs=document.querySelector(".nav");
       console.log(navs); */

       var nav1=document.querySelectorAll("nav");
       console.log(nav1);
       </script>
</body>
</html>